package router

import (
	"api-getaway/handler/api"
	"github.com/gin-gonic/gin"
)

func Router(r *gin.Engine) {
	apiGroup := r.Group("/api")
	{
		//用户
		user := apiGroup.Group("/user")
		{
			user.POST("/register", api.Register) //注册
			user.POST("/login", api.Login)       //登录
		}

		//视频
		video := apiGroup.Group("/video")
		{
			video.POST("/add", api.AddVideo)         //发布视频
			video.GET("/list", api.GetVideoList)     //视频列表
			video.GET("/detail", api.GetVideoDetail) //视频详情
		}

		//审核
		check := apiGroup.Group("/check")
		{
			check.POST("/videoStatus", api.CheckVideoStatus) //审核视频状态
		}

		//点赞
		like := apiGroup.Group("/like")
		{
			like.POST("/add", api.AddLike) //点赞
			like.POST("/del", api.DelLike) //取消点赞
		}

		//封面
		upload := apiGroup.Group("/upload")
		{
			upload.POST("/cover", api.UploadCover) //上传封面
		}

	}
}
